# 随机数的库
# import random
# 产生0-244中间一个随机数
# print("172.25.254."+ str(random.randint(0,244)))

# 实例1
# import random
# # f = open("d:\\ips.txt","w")     # 绝对路径
# f = open("ips.txt","w")           # 相对路径
# for i in range(200):
#     f.write("172.25.254."+ str(random.randint(0,244))+"\n")
# f.close()


# 实例2
# 定义一个字典存放姓名 总金额
d = {}
f = open("a.csv","r")
data = []
for line in f:
    ls = line.strip("\n").split("\t")
    data.append(ls)
    print(ls)
for i in range(1,len(data)):
    # print(len(l))
    print(data[1]+":"+data[3])
    d[l[1]] = d.get(l[1],0)+int(l[3])
f.close()
print(d)
